using System.Web.Mvc;

namespace ENail.Portal.Web.Code
{
    #region Using Directives

    

    #endregion

    /// <summary>
    /// UrlHelper extension methods. 
    /// </summary>
    public static class UrlHelperExtensions
    {
        public static string Images(this UrlHelper urlHelper, string fileName)
        {
            return urlHelper.Content(string.Format("~/Content/images/{0}", fileName));
        }
        /// <summary>
        /// Build image path. Root image is ~/Content/Images
        /// </summary>
        /// <param name="urlHelper"></param>
        /// <param name="subfolder">sub folder path in ~/Content/Images </param>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public static string Images(this UrlHelper urlHelper, string subfolder, string fileName)
        {
            if (string.IsNullOrEmpty(subfolder))
                return urlHelper.Content(string.Format("~/Content/images/{0}", fileName));
            else
                return urlHelper.Content(string.Format("~/Content/images/{0}/{1}", subfolder, fileName));
        }
        public static string MakeLogos(this UrlHelper urlHelper, string logofileName )
        {
            return urlHelper.Content(string.Format("~/Content/images/makelogos/{0}", logofileName));
        }
        public static string CategoryImages(this UrlHelper urlHelper, string  illustrateImage)
        {
            return urlHelper.Content(string.Format("~/Content/images/categories/{0}", illustrateImage));
        }
    } 
}